﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace AudioDemo.View
{
    /// <summary>
    /// convert3.xaml 的交互逻辑
    /// </summary>
    public partial class convert3 : Window
    {
        public convert3()
        {
            InitializeComponent();
        }
    }
public class RGBConverter : IMultiValueConverter
{
    //正向修改，整合颜色值
    public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
    {
        if (values == null || values.Length < 3)
            return null;
        byte r = System.Convert.ToByte(values[0]);
        byte g = System.Convert.ToByte(values[1]);
        byte b = System.Convert.ToByte(values[2]);
        Color col = Color.FromRgb(r, g, b);
        SolidColorBrush brush = new SolidColorBrush(col);
        return brush;
    }
    public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
    {
        return null;
    }
}
}
